<%@ include file="header.jsp"%>
<%@ page import="bcared.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>

<%
ServiceOrder curServiceOrder = new ServiceOrder(1500); 
int custid = curServiceOrder.getCustomerID();
ResultSet rsProblem = null;	
rsProblem = curServiceOrder.getSOType();


//String SO = request.getParameter("SOID").toString();
//readonly so id and useful table, make resolution txt

%>
<TD width="850" vAlign="top">  
<form name=form2 action=##### method=post ">
<h2>Service Order Details</h2>


<table width=1000 border="3" cellpadding="10">

<tr>
<td width=25%>Service Order ID:</td>
<td width=25%><input maxlength=30 name=soid size=40 type=text readonly=readonly value='<%=curServiceOrder.getSOID() %>'/></td>
<td width=25%>Customer Name:</td>
<td width=25%><input maxlength=30 name=custName size=40 type=text value='<%=curServiceOrder.getCustomerName() %>'/></td>
</tr>


<tr>
<td width=25%>Service Order Description:</td>
<td width=25%><select name=soDesc onChange=chkPriority() >
<% while (rsProblem.next()) { %>
<option value=<%=rsProblem.getString("serviceordertypeid")%>><%=rsProblem.getString("servicetypedescription")%></option>
<% } %>
</select></td>
<td width=25%>Contact Name:</td>
<td width=25%><input maxlength=30 name=contactName size=40 type=text value='<%=curServiceOrder.getContactName() %>'/></td>
</tr>


<tr>
<td width=25%>Open Date:</td>
<td width=25%><input maxlength=30 name=OpenDate size=40 type=text value='<%=curServiceOrder.getOpenDate() %>'/></td>
<td width=25%>Contact Telephone Number:</td>
<td width=25%><input maxlength=30 name=CloseDate size=40 type=text value='<%=curServiceOrder.getContactPhone() %>'/></td>
</tr>


<tr>
<td width=25%>Close Date:</td>
<td width=25%><input maxlength=30 name=CloseDate size=40 type=text value='<%=curServiceOrder.getCloseDate() %>'/></td>
<td width=25%>Priority Description:</td>  
<td width=25%><input maxlength=30 name=PriorityID size=40 type=text readonly=readonly value='<%=curServiceOrder.getPriorityDescription() %>'/></td>
</tr>


<tr>
<td colspan=2>&nbsp;</td>
<td>Patient on Table?</td>  
<td width=25%><td width=25%><input type="checkbox" name=Urgency onChange=getUrgent()></td>
</tr>

<tr>
<td colspan="4"><hr/></td>
</tr>

<tr>
<td colspan="4"><h3>Description</h3></td>
</tr>


<tr>
<td width=25%>Problem Description:</td>
<td width=25%><input maxlength=30 name=probDesc size=40 type=text value='<%=curServiceOrder.getServiceTypeDescription() %>'/></td>
<td width=25%>Estimate Time of Completion:</td>
<td width=25%><input maxlength=30 name=estTime size=40 type=text value='<%=curServiceOrder.getTimeEstimate() %>'/></td>
</tr>


<tr> 
<td width=25%>Current Status:</td>
<td width=25%><input maxlength=30 name=CurrStat size=40 type=text readonly=readonly value='<%=curServiceOrder.getSOStatusDesc() %>'/></td>
<td width=25%>Product Name:</td>
<td width=25%><input maxlength=30 name=ProductName size=40 type=text readonly=readonly value='<%=curServiceOrder.getProductName() %>'/></td>
</tr>


<tr>
<td width=25%>Resolution Notes:</td>
<td colspan="3"><input maxlength=30 name=Resolution size=130 type=text readonly=readonly value='<%=curServiceOrder.getResolutionNotes() %>'/></td>
</tr>


<tr>
<td colspan="4"><hr/></td>
</tr>


<tr>
<td colspan="4"><h3>Customer Details</h3></td>
</tr>


<tr>
<td width=25%>Customer ID:</td>
<td width=25%><input maxlength=30 name=CustID size=40 type=text readonly=readonly value='<%=curServiceOrder.getCustomerID() %>'/></td>
<td width=25%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address:</td>
<td width=25%><input maxlength=30 name=custName size=40 type=text readonly=readonly value='<%=curServiceOrder.getAddress1() %>'/></td>
</tr>


<tr>
<td width=25%>Email:</td>
<td width=25%><input maxlength=30 name=email size=40 type=text readonly=readonly value='<%=curServiceOrder.getContactEmail() %>'/></td>
<td width=25%></td>
<td width=25%><input maxlength=30 name=Address2 size=40 type=text readonly=readonly value='<%=curServiceOrder.getAddress2() %>'/></td>
</tr>


<tr>
<td width=25%></td>
<td width=25%></td>
<td width=25%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;City:</td>
<td width=25%><input maxlength=30 name=City size=40 type=text readonly=readonly value='<%=curServiceOrder.getCity() %>'/></td>
</tr>


<tr>
<td width=25%></td>
<td width=25%></td>
<td width=25%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;State:</td>
<td width=25%><input maxlength=30 name=State size=40 type=text readonly=readonly value='<%=curServiceOrder.getState() %>'/></td>
</tr>


<tr>
<td width=25%></td>
<td width=25%></td>
<td width=25%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zip:</td>
<td width=25%><input maxlength=30 name=Zip size=40 type=text readonly=readonly value='<%=curServiceOrder.getZip() %>'/></td>
</tr>

</table>
</form>
		</TD>
	</TR>
</TABLE>

</body>
<script Language=JavaScript>

function chkPriority() {
	if (form2.soDesc.value == 3 || form2.soDesc.value == 4 || form2.soDesc.value == 7 || form2.soDesc.value == 8)
	{  
		form2.PriorityID.value="High"; 
		return ;   
	} 
	if (form2.soDesc.value == 1 || form2.soDesc.value == 6)
	{  
		form2.PriorityID.value="Medium"; 
		return ;   
	}
	if (form2.soDesc.value == 2 || form2.soDesc.value == 5 || form2.soDesc.value == 9)
	{  
		form2.PriorityID.value="Low"; 
		return ;   
	}
}

function getUrgent() {
	if (form2.Urgency.checked == true){
			form2.PriorityID.value="Patient on Table"; 
			}else{
			form2.PriorityID.value=" ";
			 }
		return ;   
}
</script>

</html>		
<%@ include file="footer.jsp"%>
